/**
 * 
 */
package com.precisosoft.mathematize.server.dao;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 * @author jewettdx
 *
 */
public abstract class BaseDao {

	  public abstract Long createObject(Object object);

	  public abstract List<Object> retrieveObjects(int maxResults, int firstResult);

	  // <persistence-unit name="com.precisosoft.mathematizey" transaction-type="RESOURCE_LOCAL">
	  private static final EntityManagerFactory entityManagerFactory =
	      Persistence.createEntityManagerFactory("com.precisosoft.mathematize");

	  public static EntityManager createEntityManager() {
	    return entityManagerFactory.createEntityManager();
	  }

	  // public static EntityManagerFactory get() {
	  //   return entityManagerFactory;
	  // }

}
